* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    min-height: 100vh;
}

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
}

.auth-box {
    background: #16213e;
    padding: 40px;
    border-radius: 16px;
    width: 380px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.auth-box .auth-logo {
    display: block;
    margin: 0 auto 10px;
    max-width: 225px;
    height: auto;
}

.auth-box h1 {
    text-align: center;
    color: #e94560;
    margin-bottom: 5px;
    font-size: 24px;
}

.auth-box h2 {
    text-align: center;
    color: #8892b0;
    margin-bottom: 25px;
    font-weight: 400;
    font-size: 16px;
}

label {
    display: block;
    margin-top: 14px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #8892b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #233554;
    border-radius: 8px;
    background: #0f0f1a;
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #e94560;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

.alert.error {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.alert.success {
    background: rgba(80, 200, 120, 0.15);
    color: #50c878;
    border: 1px solid rgba(80, 200, 120, 0.3);
}

.link {
    text-align: center;
    margin-top: 20px;
    color: #8892b0;
    font-size: 14px;
}

.link a {
    color: #e94560;
    text-decoration: none;
}

.link a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: #233554;
    transition: background 0.2s;
}

.btn:hover { background: #2a4066; }
.btn-primary { background: #e94560; }
.btn-primary:hover { background: #c73650; }
.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #b02a37; }
.btn-secondary { background: #495057; }
.btn-secondary:hover { background: #6c757d; }
.btn-success { background: #28a745; }
.btn-success:hover { background: #218838; }
.btn-export { background: #0f3460; }
.btn-export:hover { background: #1a4a80; }
.btn-logout { background: #6c3483; }
.btn-logout:hover { background: #8e44ad; }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #16213e;
    border-bottom: 1px solid #233554;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: #e94560;
}

.nav-brand img {
    height: 35px;
    width: auto;
    vertical-align: middle;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user {
    color: #8892b0;
    font-size: 14px;
    margin-right: 5px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input {
    width: 250px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
    background: #16213e;
}

.stock-table thead th {
    background: #0f3460;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8892b0;
    border-bottom: 2px solid #233554;
    white-space: nowrap;
}

.stock-table tbody td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid #1a1a2e;
    font-size: 14px;
}

.stock-table tbody tr:hover {
    background: rgba(233, 69, 96, 0.05);
}

.col-photo {
    width: 120px;
}

.col-code {
    min-width: 120px;
}

.col-size {
    min-width: 80px;
}

.col-total {
    min-width: 70px;
    color: #e94560;
}

.thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #233554;
}

.thumb:hover {
    transform: scale(1.1);
    border-color: #e94560;
}

.no-photo {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f1a;
    border-radius: 8px;
    font-size: 10px;
    color: #495057;
    margin: 0 auto;
}

.has-stock {
    color: #50c878;
    font-weight: 600;
}

.no-stock {
    color: #495057;
}

.empty-row {
    padding: 40px !important;
    color: #495057;
    font-size: 16px;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #16213e;
    border-radius: 16px;
    padding: 30px;
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

.modal-image {
    background: transparent;
    padding: 0;
    width: auto;
    max-width: 90vw;
}

.modal-image img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #e94560;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: #8892b0;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #e94560;
}

.admin-section {
    background: #16213e;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.admin-section h2 {
    color: #e94560;
    margin-bottom: 16px;
    font-size: 18px;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #233554;
}

.user-row:last-child {
    border-bottom: none;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-meta {
    font-size: 12px;
    color: #8892b0;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin { background: rgba(233, 69, 96, 0.2); color: #e94560; }
.badge-user { background: rgba(15, 52, 96, 0.5); color: #8892b0; }
.badge-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.badge-viewer { background: rgba(23, 162, 184, 0.2); color: #17a2b8; }

.col-color {
    min-width: 140px;
    max-width: 180px;
    font-size: 12px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.btn-request {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 12px;
    padding: 10px;
    background: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-request:hover { background: rgba(23, 162, 184, 0.25); }

.ac-wrap {
    position: relative;
}

.ac-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f0f1a;
    border: 1px solid #233554;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 1100;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.ac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #e0e0e0;
    transition: background 0.15s;
}

.ac-item:hover {
    background: rgba(233, 69, 96, 0.15);
    color: #fff;
}

@media (max-width: 768px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-form { width: 100%; }
    .search-form input { flex: 1; }
    .toolbar-actions { justify-content: center; }
    .navbar { flex-direction: column; gap: 10px; }
    .nav-right { flex-wrap: wrap; justify-content: center; }
}
