/* =====================================================
   차움 결과지 발송 시스템 - 메인 스타일시트
   Professional Business Design
   ===================================================== */

/* ----- Reset & Base ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Primary Colors - Professional Blue */
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;

    /* Secondary Colors */
    --secondary: #7C3AED;
    --secondary-light: #8B5CF6;

    /* Sidebar Colors */
    --sidebar-bg: #1E1E2D;
    --sidebar-bg-light: #2D2D3F;
    --sidebar-text: #9CA3AF;
    --sidebar-text-active: #FFFFFF;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(79, 70, 229, 0.2);

    /* Status Colors */
    --success: #10B981;
    --success-light: #34D399;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #F87171;
    --danger-bg: #FEE2E2;
    --info: #3B82F6;
    --info-light: #60A5FA;
    --info-bg: #DBEAFE;

    /* Background Colors */
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-white: #FFFFFF;
    --bg-dark: #0F172A;

    /* Text Colors */
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* Border & Shadow */
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

html {
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

/* ----- Layout ----- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-area {
    flex: 1;
    padding: 24px;
    max-width: 1600px;
}

/* ----- Sidebar ----- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition-slow), transform var(--transition-slow);
    overflow: hidden;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    transition: opacity var(--transition-normal);
}

body.sidebar-collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.logo-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--sidebar-text);
    font-weight: 500;
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--sidebar-hover);
    border-radius: 6px;
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.sidebar-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-menu {
    list-style: none;
    padding: 0 8px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    border-radius: 8px;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active > .nav-link {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity var(--transition-normal);
}

body.sidebar-collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.nav-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast), opacity var(--transition-normal);
}

.nav-item.has-submenu.open > .nav-link .nav-arrow {
    transform: rotate(180deg);
}

body.sidebar-collapsed .nav-arrow {
    opacity: 0;
}

/* Submenu */
.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-top: 4px;
}

.nav-item.has-submenu.open > .nav-submenu {
    max-height: 500px;
    padding: 4px 0;
}

body.sidebar-collapsed .nav-submenu {
    display: none;
}

.nav-subitem {
    margin: 0;
    padding: 0;
}

.nav-sublink {
    display: block;
    padding: 10px 12px 10px 48px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 400;
    border-radius: 0;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

.nav-sublink::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sidebar-text);
    opacity: 0.4;
}

.nav-sublink:hover {
    color: var(--sidebar-text-active);
    background: rgba(255, 255, 255, 0.05);
}

.nav-sublink:hover::before {
    opacity: 0.8;
}

.nav-subitem.active .nav-sublink {
    color: #fff;
    background: rgba(79, 70, 229, 0.3);
}

.nav-subitem.active .nav-sublink::before {
    background: var(--primary-light);
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity var(--transition-normal);
}

body.sidebar-collapsed .user-details {
    opacity: 0;
    width: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--sidebar-text);
    white-space: nowrap;
}

.version {
    font-size: 11px;
    color: var(--sidebar-text);
    text-align: center;
    opacity: 0.6;
}

body.sidebar-collapsed .version {
    display: none;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: all var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ----- Header ----- */
.main-header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--border-color);
}

.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    margin: 4px auto;
    transition: all var(--transition-fast);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-date {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.user-info:hover {
    background: var(--bg-secondary);
}

.user-info .user-avatar-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 13px;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* ----- Footer ----- */
.main-footer {
    padding: 16px 24px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ----- Alerts ----- */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.alert-success {
    background: var(--success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: var(--danger-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* ----- Cards ----- */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-light);
}

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

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

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: var(--warning-light);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-light);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

/* ----- Forms ----- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-control.error {
    border-color: var(--danger);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ----- Tables ----- */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table-actions {
    display: flex;
    gap: 6px;
}

/* ----- Badges ----- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-dark);
}

.badge-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-success {
    background: var(--success-bg);
    color: #065F46;
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400E;
}

.badge-danger {
    background: var(--danger-bg);
    color: #991B1B;
}

.badge-info {
    background: var(--info-bg);
    color: #1E40AF;
}

.badge-default {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ----- Pagination ----- */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
}

.pagination li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination li a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-light);
}

.pagination li.active a {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ----- Workflow Progress ----- */
.workflow-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 20px 0;
    overflow-x: auto;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.workflow-step-box {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.workflow-step.completed .workflow-step-box {
    background: var(--success-bg);
    color: #065F46;
    border-color: var(--success);
}

.workflow-step.current .workflow-step-box {
    background: var(--primary-100);
    color: var(--primary-dark);
    border-color: var(--primary);
}

.workflow-arrow {
    color: var(--text-light);
    font-size: 18px;
}

/* ----- Stats Cards ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary { background: var(--primary-100); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ----- Empty State ----- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
    margin-bottom: 20px;
}

/* ----- Search Box ----- */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-box .form-control {
    flex: 1;
}

/* ----- Filter Bar ----- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}

/* ----- Login Page ----- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.login-logo .logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.login-logo .logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.login-logo .logo-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.login-logo .logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.login-title {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* ----- Modal ----- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* ----- Toast Notification ----- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: var(--text-primary);
    color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 1100;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-collapse-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .content-area {
        padding: 16px;
    }

    .table th,
    .table td {
        padding: 10px 12px;
    }

    .header-date {
        display: none;
    }

    .user-info-text {
        display: none;
    }
}

/* ----- Print Styles ----- */
@media print {
    .sidebar,
    .main-header,
    .btn,
    .filter-bar,
    .pagination-wrap {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    body {
        background: #fff !important;
    }
}
