* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

/* ================= GENEL ================= */

.hidden {
    display: none !important;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

textarea {
    resize: vertical;
}

/* ================= LOGIN ================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.20), transparent 35%),
        linear-gradient(135deg, #eff6ff, #f8fafc);
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 26px;
    padding: 36px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
    border: 1px solid #e5e7eb;
}

.admin-logo {
    text-align: center;
    margin-bottom: 28px;
}

.admin-logo h1 {
    font-size: 34px;
    letter-spacing: 5px;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.admin-logo p {
    color: #64748b;
    font-size: 14px;
    letter-spacing: 1px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
    color: #0f172a;
}

.login-btn {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    padding: 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.34);
}

.login-info {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: #64748b;
}

.login-error {
    margin-top: 14px;
    text-align: center;
    color: #dc2626;
    font-weight: 700;
    font-size: 14px;
}

/* ================= ADMIN PANEL ================= */

.admin-panel {
    min-height: 100vh;
    padding: 28px;
}

.admin-header {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 28px;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.admin-header p {
    color: #64748b;
    font-size: 14px;
}

.logout-btn {
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.logout-btn:hover {
    background: #fecaca;
    transform: translateY(-2px);
}

/* ================= DASHBOARD ================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
}

.dashboard-card span {
    display: block;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-card strong {
    font-size: 32px;
    color: #1e3a8a;
}

/* ================= LAYOUT ================= */

.admin-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}

.product-form-card,
.product-list-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
}

.product-form-card h2,
.product-list-card h2 {
    font-size: 22px;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 18px 0 20px;
}

.checkbox-row label {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.checkbox-row input {
    width: auto;
    margin-right: 6px;
}

/* ================= BUTTONS ================= */

.form-actions {
    display: flex;
    gap: 12px;
}

.save-btn,
.clear-btn {
    border: none;
    padding: 13px 18px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.save-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    flex: 1;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.clear-btn {
    background: #f1f5f9;
    color: #334155;
}

.save-btn:hover,
.clear-btn:hover {
    transform: translateY(-2px);
}

/* ================= ÜRÜN LİSTESİ ================= */

.list-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.list-header input {
    max-width: 280px;
}

.admin-product-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    padding: 28px;
    border-radius: 18px;
    text-align: center;
    font-weight: 700;
}

.admin-product-item {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    gap: 16px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px;
}

.admin-product-img {
    width: 78px;
    height: 78px;
    border-radius: 16px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}

.admin-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-product-info h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #0f172a;
}

.admin-product-info p {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 4px;
}

.admin-product-price {
    font-weight: 900;
    color: #1e3a8a;
}

.admin-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.admin-badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.admin-badge.new {
    background: #dbeafe;
    color: #1d4ed8;
}

.admin-badge.campaign {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-badge.passive {
    background: #e5e7eb;
    color: #475569;
}

.admin-product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-btn,
.delete-btn {
    border: none;
    padding: 9px 13px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.edit-btn {
    background: #dbeafe;
    color: #1d4ed8;
}

.delete-btn {
    background: #fee2e2;
    color: #b91c1c;
}

.edit-btn:hover,
.delete-btn:hover {
    transform: translateY(-2px);
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1000px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .admin-panel {
        padding: 16px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .list-header input {
        max-width: 100%;
    }

    .admin-product-item {
        grid-template-columns: 1fr;
    }

    .admin-product-actions {
        flex-direction: row;
    }
}
/* ================= GÖRSEL YÜKLEME YARDIMCI YAZISI ================= */

.form-help {
    font-size: 12px;
    color: #64748b;
    margin-top: -6px;
}
/* ================= YÖNETİCİ HESAP AYARLARI ================= */

.account-settings-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.account-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.account-settings-header h2 {
    font-size: 22px;
    color: #1e3a8a;
    margin-bottom: 6px;
}

.account-settings-header p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.account-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.account-settings-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.account-save-btn {
    border: none;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #ffffff;
    padding: 13px 20px;
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.20);
}

.account-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.26);
}

.account-message {
    font-size: 14px;
    font-weight: 800;
    color: #64748b;
}

.account-message.success {
    color: #16a34a;
}

.account-message.error {
    color: #dc2626;
}

@media (max-width: 1100px) {
    .account-settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .account-settings-grid {
        grid-template-columns: 1fr;
    }

    .account-settings-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .account-save-btn {
        width: 100%;
    }
}
/* ================= BEDEN BAZLI STOK YÖNETİMİ ================= */

.size-stock-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
    margin: 6px 0 20px;
}

.size-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.size-stock-header h3 {
    font-size: 17px;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.size-stock-header p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

#generateSizeStockBtn {
    border: none;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 11px 15px;
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.22s ease;
    white-space: nowrap;
}

#generateSizeStockBtn:hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-2px);
}

.size-stock-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.size-stock-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
}

.size-stock-item label {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #334155;
    margin-bottom: 8px;
}

.size-stock-item input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.size-stock-empty {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
}

.size-stock-summary {
    margin-top: 14px;
    padding: 12px 14px;
    background: #ecfdf5;
    color: #15803d;
    border-radius: 14px;
    font-weight: 900;
    font-size: 14px;
    border: 1px solid #bbf7d0;
}

@media (max-width: 650px) {
    .size-stock-header {
        flex-direction: column;
    }

    #generateSizeStockBtn {
        width: 100%;
    }
}
/* ================= ADMIN FORM DÜZEN TOPARLAMA ================= */

.admin-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 420px !important;
    gap: 24px !important;
    align-items: start !important;
}

.admin-form-card,
.product-form-card,
.form-card {
    width: 100% !important;
    max-width: 100% !important;
}

.product-list-card,
.admin-products-card,
.products-card {
    width: 100% !important;
    max-width: 420px !important;
    position: sticky !important;
    top: 20px !important;
}

/* Form satırlarını daha düzenli yap */
.form-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Beden stok alanı form içinde tam satır kaplasın */
.size-stock-card {
    grid-column: 1 / -1 !important;
}

/* Açıklama alanı tam genişlik olsun */
.form-group:has(textarea),
.form-group textarea {
    grid-column: 1 / -1 !important;
}

/* Fiyat alanları da daha kompakt dursun */
.form-group input[type="number"] {
    max-width: 100% !important;
}

/* Ürün formu çok yayılmasın */
.form-card form,
.product-form-card form,
.admin-form-card form {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

/* Mobilde tek sütun */
@media (max-width: 1100px) {
    .admin-layout {
        grid-template-columns: 1fr !important;
    }

    .product-list-card,
    .admin-products-card,
    .products-card {
        max-width: 100% !important;
        position: static !important;
    }
}

@media (max-width: 700px) {
    .form-row {
        grid-template-columns: 1fr !important;
    }
}
/* ================= ADMIN ÜRÜN LİSTESİ BEDEN STOKLARI ================= */

.admin-size-stock-box {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
}

.admin-size-stock-title {
    font-size: 12px;
    font-weight: 900;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.admin-size-stock-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-size-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.admin-size-stock-pill strong {
    color: #0f172a;
}

.admin-size-stock-pill.ok {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.admin-size-stock-pill.low {
    color: #d97706;
    border-color: #fed7aa;
    background: #fff7ed;
}

.admin-size-stock-pill.out {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.admin-size-stock-empty {
    font-size: 12px;
    color: #64748b;
    font-weight: 800;
}
/* ================= ADMIN PANEL MOBİL UYUMLULUK ================= */

@media (max-width: 900px) {

    body {
        overflow-x: hidden !important;
    }

    .login-card {
        width: 92% !important;
        max-width: 420px !important;
        padding: 26px 22px !important;
        border-radius: 24px !important;
    }

    .admin-panel,
    .admin-container,
    .admin-main {
        width: 100% !important;
        padding: 16px !important;
        overflow-x: hidden !important;
    }

    .admin-header,
    .admin-topbar,
    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .admin-header h1,
    .admin-topbar h1 {
        font-size: 26px !important;
        line-height: 1.2 !important;
    }

    .logout-btn,
    #logoutBtn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    .dashboard-cards,
    .stats-grid,
    .admin-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .dashboard-card,
    .stat-card {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .admin-layout {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .account-settings-grid {
        grid-template-columns: 1fr !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        font-size: 15px !important;
    }

    .size-stock-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #generateSizeStockBtn {
        width: 100% !important;
        text-align: center !important;
    }

    .size-stock-fields {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .product-list-card,
    .admin-products-card,
    .products-card {
        max-width: 100% !important;
        position: static !important;
    }

    .admin-product-item {
        display: grid !important;
        grid-template-columns: 95px 1fr !important;
        gap: 14px !important;
        align-items: start !important;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .admin-product-img {
        width: 95px !important;
        height: 120px !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    .admin-product-img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    .admin-product-info h3 {
        font-size: 16px !important;
        line-height: 1.25 !important;
    }

    .admin-product-info p {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    .admin-product-price {
        font-size: 16px !important;
    }

    .admin-product-badges {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .admin-product-actions {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .admin-product-actions button {
        width: 100% !important;
        padding: 11px !important;
        border-radius: 999px !important;
    }

    .admin-size-stock-box {
        grid-column: 1 / -1 !important;
        margin-top: 8px !important;
    }

    .admin-size-stock-list {
        gap: 6px !important;
    }

    .admin-size-stock-pill {
        font-size: 10px !important;
        padding: 5px 7px !important;
    }
}

@media (max-width: 520px) {

    .admin-panel,
    .admin-container,
    .admin-main {
        padding: 12px !important;
    }

    .dashboard-cards,
    .stats-grid,
    .admin-stats {
        grid-template-columns: 1fr !important;
    }

    .form-card,
    .product-form-card,
    .admin-form-card,
    .account-settings-card,
    .product-list-card,
    .admin-products-card,
    .products-card {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    .size-stock-fields {
        grid-template-columns: 1fr 1fr !important;
    }

    .admin-product-item {
        grid-template-columns: 1fr !important;
    }

    .admin-product-img {
        width: 100% !important;
        height: 180px !important;
    }

    .admin-product-actions {
        grid-template-columns: 1fr !important;
    }

    .account-settings-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .account-save-btn,
    #updateCredentialsBtn,
    #saveProductBtn,
    .save-btn {
        width: 100% !important;
    }

    .product-search,
    #productSearch,
    .admin-search-input {
        width: 100% !important;
    }
}