*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #0f9d58;
    --danger: #d93025;
    --warning: #f9ab00;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-600: #5f6368;
    --gray-900: #202124;
    --sidebar-width: 230px;
    --topbar-height: 56px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background: var(--primary);
    color: #fff;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.topbar-simple {
    position: relative;
}

.topbar-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
}

.topbar-nav {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.topbar-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.topbar-nav a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* Layout wrapper */
.layout-wrapper {
    display: flex;
    padding-top: var(--topbar-height);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--gray-200);
    flex-shrink: 0;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    padding: 0.75rem 0;
}

.sidebar-link {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.sidebar-link.active {
    background: #e8f0fe;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar-divider {
    margin: 0.75rem 1.25rem;
    border: none;
    border-top: 1px solid var(--gray-200);
}

.sidebar-label {
    display: block;
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
}

/* Main content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--topbar-height));
}

/* Footer */
.footer {
    background: var(--gray-100);
    padding: 0.75rem 1.5rem;
    margin-left: var(--sidebar-width);
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-600);
    border-top: 1px solid var(--gray-200);
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.dashboard-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-icon-blue { background: #e8f0fe; color: var(--primary); }
.stat-icon-green { background: #e6f4ea; color: var(--success); }
.stat-icon-red { background: #fce8e6; color: var(--danger); }
.stat-icon-purple { background: #f3e8fd; color: #7c3aed; }

.stat-body {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--gray-600);
    margin-top: 0.125rem;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--gray-900);
    transition: background 0.15s;
}

.quick-link:hover {
    background: var(--gray-100);
}

.quick-link-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 0.375rem;
}

.quick-link-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.bank-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bank-chip {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 1.5rem;
    padding: 0.375rem 1rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.empty-state {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 0;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.825rem;
}

.table th {
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    white-space: nowrap;
}

.table tr:hover {
    background: var(--gray-50);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: #e6f4ea; color: #1e4620; }
.badge-danger  { background: #fce8e6; color: #8b1a13; }
.badge-warning { background: #fef7e0; color: #5c3b00; }
.badge-info    { background: #e8f0fe; color: #174ea6; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--gray-600);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.85rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

select.form-control {
    appearance: auto;
}

/* Alerts */
.alert {
    padding: 0.7rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #e6f4ea;
    color: #1e4620;
    border: 1px solid #ceead6;
}

.alert-danger {
    background: #fce8e6;
    color: #8b1a13;
    border: 1px solid #f5c6c2;
}

.alert-warning {
    background: #fef7e0;
    color: #5c3b00;
    border: 1px solid #fde293;
}

.alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    color: inherit;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .topbar-nav {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .footer {
        margin-left: 0;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Slip / Fiş */
.slip-container {
    max-width: 700px;
    margin: 0 auto;
}

.slip {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.slip-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.slip-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.slip-subtitle {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.slip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.slip-table th,
.slip-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
    vertical-align: top;
}

.slip-table th {
    width: 40%;
    font-weight: 600;
    color: var(--gray-600);
    text-align: left;
}

.slip-table td {
    width: 60%;
    color: var(--gray-900);
}

.slip-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Print styles */
@media print {
    body {
        background: #fff !important;
        margin: 0;
        padding: 0;
    }

    .topbar,
    .sidebar,
    .sidebar-toggle,
    .footer,
    .slip-actions,
    .btn,
    .alert {
        display: none !important;
    }

    .layout-wrapper,
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    .slip-container {
        max-width: 100%;
        margin: 0;
    }

    .slip {
        border: none;
        box-shadow: none;
        padding: 1.5cm 2cm;
        border-radius: 0;
    }

    .slip-header {
        border-bottom-color: #000;
    }

    .slip-table th,
    .slip-table td {
        border-bottom-color: #ccc;
        font-size: 10pt;
    }

    .slip-table th {
        color: #333;
    }

    @page {
        margin: 0;
        size: A4 portrait;
    }
}

/* Test panel */
.test-panel {
    margin: 0 auto;
}

.test-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.test-card-header {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.test-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.test-card-body {
    padding: 1rem;
}

.test-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.test-status.ok { color: var(--success); }
.test-status.fail { color: var(--danger); }
.test-status.warn { color: var(--warning); }

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.5rem;
}

.test-item {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.test-item-label {
    color: var(--gray-600);
}

.test-item-value {
    font-weight: 500;
}

.test-missing {
    color: var(--danger);
    font-size: 0.75rem;
}

.test-present {
    color: var(--success);
    font-size: 0.75rem;
}