:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --border-color: #dcdde1;
    --text-color: #2f3640;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--light-bg);
    color: var(--text-color);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

nav {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent-color);
}

main {
    min-height: 70vh;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    background: #ecf0f1;
}

.flashes {
    list-style: none;
    margin-bottom: 1.5rem;
}

.flashes li {
    padding: 1rem;
    background: var(--error-color);
    color: var(--white);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.card, .auth-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.auth-card {
    max-width: 400px;
    margin: 4rem auto;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--secondary-color);
}

.btn-primary { background: var(--accent-color); }
.btn-primary:hover { background: #2980b9; }

.btn-success { background: var(--success-color); }
.btn-success:hover { background: #219150; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.aks-format-guide {
    background: #e1f5fe;
    padding: 1rem;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.dev-info {
    margin-top: 1.5rem;
    color: #7f8c8d;
    text-align: center;
}

/* QR Grid Results */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.qr-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.qr-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
    margin-bottom: 1rem;
}

.aks-tag-label {
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.4rem; /* Increased as requested */
    color: var(--primary-color);
    word-break: break-all;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 0;
    }
    body {
        background: white;
        padding: 0;
        margin: 0;
        width: 210mm;
        height: 297mm;
    }
    nav, footer, .no-print, .header-actions {
        display: none !important;
    }
    .container {
        max-width: none;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .print-area {
        display: block !important;
        width: 210mm;
        height: 297mm;
        box-sizing: border-box;
    }
    .qr-grid-print {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        width: 210mm;
        height: 297mm;
        padding: 15mm;
        gap: 10mm;
        box-sizing: border-box;
        align-items: center;
        justify-items: center;
    }
    .qr-item-print {
        border: 1px dashed #999; /* Cutting lines */
        padding: 10mm; /* Extra space for cutting */
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 65mm;
        height: 95mm;
        page-break-inside: avoid;
        box-sizing: border-box;
    }

/* Progress Overlay */
#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.progress-container {
    width: 300px;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar-ind {
    width: 0%;
    height: 100%;
    background: var(--accent-color);
    animation: progress-load 2s infinite ease-in-out;
}

@keyframes progress-load {
    0% { width: 0%; margin-left: 0; }
    50% { width: 100%; margin-left: 0; }
    100% { width: 0%; margin-left: 100%; }
}
    .qr-item-print img {
        width: 100%;
        max-width: 60mm;
        height: auto;
    }
    .aks-tag-label-print {
        font-weight: bold;
        font-size: 16pt;
        margin-bottom: 10px;
        font-family: 'Droid Sans', sans-serif;
        text-align: center;
        width: 100%;
    }
}

@media screen {
    .qr-grid-print {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
        margin-top: 2rem;
    }
    .qr-item-print {
        background: var(--white);
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        text-align: center;
    }
    .qr-item-print img {
        max-width: 100%;
        height: auto;
        border: 1px solid #eee;
        margin-bottom: 1rem;
    }
    .aks-tag-label-print {
        font-weight: bold;
        margin-bottom: 1rem;
        font-size: 1.4rem;
        color: var(--primary-color);
        word-break: break-all;
        border-bottom: 2px solid #eee;
        padding-bottom: 0.5rem;
    }
}

/* Admin Table */
.user-table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--light-bg);
    color: var(--secondary-color);
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

.form-row input {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
